* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  font-weight: 800;

  color-scheme: light dark;
  color: rgba(0, 0, 0, 0.87);
  background-color: #f5f5f5;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 640px;
  min-height: 100vh;
}

#root {
  width: 100%;
  min-height: 100vh;
}

.app-container {
  width: 100%;
  min-height: 100vh;
}

.header {
  background-color: #1890ff;
  color: white;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

.content {
  padding: 24px;
  max-width: 2400px;
  margin: 0 auto;
}

.tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .tool-cards {
    grid-template-columns: 1fr;
  }
}

/* 工具页面的公共样式 */
.tool-page {
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 100%;
}

/* 翻译页面左右分栏布局 */
.translation-layout {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}

/* 左侧输入区域样式 */
.input-section {
  flex: 1;
  min-width: 0;
  position: relative;
}

/* 右侧输出区域样式 */
.output-section {
  flex: 1;
  min-width: 0;
}

/* 响应式布局 - 移动端变为上下布局 */
@media (max-width: 1024px) {
  .translation-layout {
    flex-direction: column;
  }
}

/* 翻译类型选项卡样式 */
.translation-tabs {
  border-bottom: none;
}

.translation-tabs .ant-tabs-nav {
  display: flex;
  justify-content: flex-start;
  padding-left: 0;
}

.translation-tabs .ant-tabs-tab {
  padding: 8px 16px;
  margin-right: 0;
  border-bottom: 2px solid transparent;
  color: #666;
}

.translation-tabs .ant-tabs-tab-active {
  color: #1890ff;
  border-bottom-color: #1890ff;
}

.tab-icon {
  margin-right: 4px;
}

/* 语言选择区域样式 */
.language-selection {
  display: flex;
  align-items: center;
  margin: 16px 0;
  padding: 8px 0;
}

.language-select {
  border: none;
  box-shadow: none !important;
}

.language-select .ant-select-selector {
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.swap-button {
  margin: 0 8px;
  transform: rotate(90deg);
}

.ai-model-label {
  margin-left: auto;
  color: #999;
  font-size: 14px;
  cursor: pointer;
}

.ai-model-label:hover {
  color: #1890ff;
}

/* 文本输入区域样式 */
.textarea-container {
  position: relative;
  width: 100%;
}

.translation-textarea {
  border-radius: 8px !important;
  resize: none;
  font-size: 16px;
  line-height: 1.6;
}

.result-textarea {
  border-radius: 8px !important;
  resize: none;
  font-size: 16px;
  line-height: 1.6;
  background-color: #f5f5f5 !important;
}

.textarea-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 8px;
  background-color: white;
  border-radius: 4px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.output-section .textarea-actions {
  background-color: #f5f5f5;
}

.copy-button {
  min-width: auto !important;
  padding: 0 8px !important;
}

/* 翻译结果区域样式 */
.translation-result {
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 16px;
}

/* 翻译结果详细信息样式 */
.translation-details {
  margin-top: 16px;
  padding: 16px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.translation-tips {
  margin-bottom: 16px;
}

.ai-label {
  font-weight: bold;
  margin-right: 8px;
}

.translation-tips ol {
  margin: 8px 0 0 20px;
  padding: 0;
}

.translation-tips li {
  margin-bottom: 8px;
}

.translation-tips ul {
  margin: 4px 0 0 20px;
  padding: 0;
}

/* 词典部分样式 */
.dictionary-section {
  margin-top: 16px;
}

.dictionary-tabs {
  display: flex;
  margin-bottom: 16px;
}

.dictionary-tab {
  margin-right: 16px;
  padding: 4px 0;
  color: #666;
}

.dictionary-tab.active {
  color: #1890ff;
  border-bottom: 2px solid #1890ff;
}

.dictionary-content {
  padding: 8px 0;
}

.word-entry h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 500;
}

.word-entry p {
  margin: 4px 0;
  color: #666;
}

/* 翻译按钮样式 */
.translate-button-container {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  margin-bottom: 16px;
}

.translate-button {
  width: 200px;
  height: 44px;
  font-size: 16px;
  font-weight: 500;
}

.tool-page h2 {
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 500;
  color: #333;
}

/* 表单样式 */
.form-section {
  margin-bottom: 48px;
}

.form-section .ant-form-item {
  margin-bottom: 32px;
}

/* 翻译页面元素样式 */
.input-section .ant-select,
.input-section .ant-input,
.input-section .ant-input-textarea,
.output-section .ant-input,
.output-section .ant-input-textarea {
  width: 100%;
}

/* 调整翻译结果文本框高度 */
.output-section .result-textarea {
  resize: none;
}

/* 按钮组样式 */
.button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .button-group {
    flex-direction: column;
  }
}

/* 结果展示样式 */
.result-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f0f0f0;
}

.result-section h3 {
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 500;
  color: #333;
}

.translation-result {
  padding: 16px;
  width: 100%;
}

.result-textarea {
  width: 100%;
}

  /* 工具卡片样式 */
  .tool-card {
    transition: all 0.3s ease;
  }

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 加载动画 */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px;
}

/* 错误提示样式 */
.error-message {
  background-color: #fff2f0;
  border: 1px solid #ffccc7;
  color: #f5222d;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
}

/* 成功提示样式 */
.success-message {
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #52c41a;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
}